'''
Created on Jan 18, 2013

@author: Artur
'''
import os
import subprocess as sp

path = 'G:/Music/Russian Rap/! RAPFRONT/'
wrar = 'C:/Program Files/WinRAR/WinRAR.exe'

for artist in os.listdir(path):
    for album in os.listdir(path + artist):
        os.chdir(path + artist + '/' + album)
        flist = []
        for f in os.listdir(os.getcwd()):
            ext = f.rsplit('.', 1)[1] 
            if ext in ['rar', 'zip']:
                os.remove(path + artist + '/' + album + '/' + f)
        
#        sp.call(wrar + ' e -y *.zip')


#os.chdir(path)
#
#sp.call(wrar + ' e *.rar')

